home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-05-30 | 9.6 KB | 205 lines | [TEXT/MMCC] |
- ******************************************************
- ******************************************************
-
- KNOWN BUGS in Mac F2C v1.2.1
-
- ******************************************************
- ******************************************************
-
-
- Most of the problems with the user interface (U/I) have been fixed as a
- result of building Mac F2C version 1.2 with Codewarrior and Codewarrior's
- SIOUX console library. However, several new U/I problems have been
- introduced. This will be fixed in future releases when I implement my own
- status window (or Codewarrior improves theirs). These, and other U/I
- problems are described below.
-
- There are no code generation problems in version 1.2 that I know of. All
- of the know problems with version 1.1 have been fixed as far as I and my
- testers can tell. For historical reference (and just in case they
- "re-appear"), they are described at the end of this document.
-
-
- KNOWN USER INTERFACE PROBLEMS:
-
- - If Mac F2C is in the background when it needs to display an alert,
- sometimes the dialog is automatically dismissed when Mac F2C is
- brought to the front. This bug is due to undesired interaction
- with the SIOUX console and is fixed in version 1.3 to be released
- this summer.
-
- Workaround: try the translation again, but this time keep Mac F2C
- in the foreground.
-
- - If Mac F2C is translating in the background, it requests to come to
- the foreground after each translation, even when there are no problems
- or alerts to post. This is fixed in version 1.3 to be released this
- summer.
-
- Workaround: bring Mac F2C into the foreground as required, or let
- Mac F2C translate in the foreground.
-
- - Mac F2C will trigger a compile of CodeWarrior PPC or CodeWarrior 68K,
- but NOT both, even if both have appropriate projects open. This is
- fixed in version 1.3 to be released this summer.
-
- Workaround: use AppleScripts to drive coordinated "makes" involving
- Mac F2C and both CW PPC and CW 68K.
-
- - Mac F2C will not trigger compiles by the Symantec Project Manager.
- This will be fixed in version 1.3 to be released this summer.
-
- Workaround: use AppleScripts to drive coordinated "makes" involving
- Mac F2C and SPM.
-
- - Mac F2C does not conform to the AppleEvent Standard Object Model.
- This is fixed in version 1.3 to be released this summer.
-
- - Mac F2C does not call WaitNextEvent as often as it should during a
- translation. This is fixed in version 1.3 to be released this
- summer.
-
- - The cursor flickers between an I-beam and an arrow while over an
- editable text field in a dialog box. This is due to an unwanted
- interaction with the SIOUX console window. Unknown when this will
- be fixed.
-
- - The "Undo" command does not work. It is not implemented at this time.
-
- - The "Save" command doesn't exist (only "Save As") and Mac F2C doesn't
- remember what file it saved to after the first save.
-
- - The "Close" command does not work. It is not implemented at this time.
- There is no way to close the translation status window in this version
- of Mac F2C.
-
- - The translation status window is always saved as a Codewarrior text
- file, regardless of the creator code specified in the "Mac F2C
- Preferences" dialog.
-
- - The translation status window has an ugly, silly title. Obviously I
- could write code to change the window's title. But because the title
- is set by the Codewarrior SIOUX library when it creates the window,
- I can only change it *after* the window appears. The title change is
- quite noticeable and *really* ugly. I found the changing title more
- offensive than the annoying default title, and since I'm the author,
- my personal taste settles the matter ;)
-
-
- KNOWN CODE GENERATION PROBLEMS:
-
- - None.
-
-
-
-
- *************************************************************
- *************************************************************
-
- OLD BUGS THAT HAVE HOPEFULLY BEEN FIXED IN VERSION 1.2
-
- *************************************************************
- *************************************************************
-
-
- Code Generation Problems (Hopefully fixed)
- *********************************************
-
- There were two code generation problems that I knew of in v1.1. **To the
- best of my knowledge, both of these are fixed in v1.2** Just in case
- these have not been completely killed, here they are together with their
- work arounds.
-
- (1) Unlabeled COMMON blocks defined in separate C files and
- declared Extern produces spurious #undef preprocessor statements
-
- This problem occurs when the program contains an unlabeled COMMON
- block and you have selected the options to define the COMMON block in
- a separate file and declare the block "Extern" in the original file
- (the factory default behavior). In this case the C version of the
- original FORTRAN file will #define a symbolic constant to refer to
- the COMMON block (which is translated as a struct). The error is
- that f2c will include an #undef statement after the end of the first
- subroutine in the file -- even if subsequent subroutines refer to that
- symbol. This produces a preprocessor error when you try to compile
- the C file (e.g., "Symbol '_BLNK__1' is undefined").
-
- There are two work-arounds for this bug:
-
- (a) Do not select the options that define COMMON blocks in separate
- files and define them Extern. Unfortunately, this will not always
- work: multiple definition errors will occur in the C code when the
- same COMMON block is used in separate files of FORTRAN code.
-
- (b) Go through the C code and delete the spurious #undef lines.
- This is usually easy to do and is the recommended solution. The
- disadvantage is that this is hard to script if you use a scripting
- tool of any kind to drive the builds of your FORTRAN code.
-
-
- (2) Make COMMON block members look like local variables produces
- spurious #undef preprocessor statements.
-
- This problem occurs if you select the option to make COMMON block
- members look like local variables. In the this case the C version
- of the original FORTRAN file will #define a simple symbolic constant
- to refer to the elements of the COMMON block (which is translated
- as a structure). The error is that some or all of these #defines
- will be #undef after the end of the first subroutine in the file --
- even if subsequent subroutines refer to these symbols. This
- produces a preprocessor error when you try to compile the C file.
-
- There are two work-arounds for this bug:
-
- (a) Do not select the options that mkae COMMON block variables
- look like local variables.
-
- (b) Go through the C code and delete the spurious #undef lines.
-
-
- *** AGAIN, I BELIEVE THAT BOTH OF THESE BUGS HAVE BEEN FIXED IN V1.2 ***
-
-
-
- The Memory Leak Problem is SOLVED!!!
- *********************************************
-
- Yes, this problem is fixed in version 1.2. And that's probably all you
- want to know. But in case you are a long-time user of Mac F2C, or want to
- know why it was hard to fix, or are just generally curious, below is a
- description of the problem and how I solved it.
-
- Versions of Mac F2C prior to 1.2 had a serious memory leak. The leak
- occurred because the original UNIX version of f2c (incorporated in Mac F2C
- as a subroutine) failed to release memory. It was quite easy to track down
- the "leaked" memory and free it. The real challenge was that f2c keeps
- pointers -- many dozens of them -- to that memory. Free the leaked memory
- and f2c is left with lots of dangling pointers. Somehow I had to
- "re-initialize" lots of variables, some of which were global, some local
- static variables -- and many of these had to be initialized to non-zero
- values. Finally, I didn't want to modify the f2c source code too much or I
- would have a maintenance nightmare every time AT&T updated their code.
-
- The solution implemented in version 1.2 is conceptually simple. Before
- executing the f2c "subroutine" I identify the block of addresses where
- "all" the global variables are stored and copy the contents into a handle.
- Then when f2c finishes, I copy the contents of that handle back to the
- original address block. Presto, all the f2c global variables (including
- static locals) are re-initialized to their original, start-up values.
-
- The hard part is identifying the appropriate address block and making sure
- that I'm selective enough to include the f2c globals, but not too much else
- (you get some very interesting crashes if you mess with QD globals or CW's
- SIOUX globals). The bottom line is that it you can do this using the link
- map, and a bit of experimentation. The solution I've implemented does NOT
- have self modifying code (which offers one "easy" way to implement this
- "automatically"). However, my implementation requires me to build Mac F2C
- twice: the first time with dummy addresses just to generate a link map, and
- the second time with the correct addresses as determined from the link map.
- And of course, I need to make sure the link map has not changed between the
- two compiles -- something very likely to happen if I accidentally change
- any compiler or linker options or I unknowningly introduce a new variable
- into the global name space through a simple typo...
-
-
-